import React from 'react';
import styles from './index.less';
import {Link} from "react-router-dom"

const ArticleSummary = ({title, id, summary,char_sum,create_time,similar_rate}) => {
  return (
    <div className={styles.container}>
      <div className={styles.title}>
        <Link to={`/article/${id}`} target="_blank">{title}</Link>
      </div>
      <div className={styles.info}>
        <div className={styles.detail}>
          <span>时间：</span>
          <span>{create_time}</span>
        </div>
        <div className={styles.detail}>
          <span>字数：{char_sum}</span>
        </div>
        <div className={styles.detail}>
          <span>重复率：</span>
          <span style={{color:'orange'}}>{similar_rate===0?'未记录':similar_rate}</span>
        </div>
      </div>
      <div className={styles.summary}>
        <div dangerouslySetInnerHTML={{__html: summary}}/>
      </div>
    </div>
  );
};

export default ArticleSummary;
